package com.experiment2;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

import org.springframework.core.env.Environment;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;



@EnableConfigurationProperties(CustomProperties.class)
public class AutoConfig {
    @Bean
    @ConditionalOnProperty(prefix = "sai.auto", name = "enable", havingValue = "true")
    CommandLineRunner createCustomCommandLineRunner(Environment env){
        return new CustomCommandLineRunner(env);
    }


}

